Current File : /var/www/vinorea/modules/autoupgrade/views/assets/segment-analytics-core-Cvc9gLK6.js |
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
import{E as t}from"./segment-analytics-generic-utils-EvPM-36Q.js";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function o(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{a(r.next(t))}catch(e){o(e)}}function u(t){try{a(r.throw(t))}catch(e){o(e)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((r=r.apply(t,e||[])).next())}))}function s(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(u){return function(a){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(a){u=[6,a],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function u(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function a(t,e,n){e.split&&(e=e.split("."));for(var r,i,o=0,s=e.length,u=t;o<s&&"__proto__"!=(i=""+e[o++])&&"constructor"!==i&&"prototype"!==i;)u=u[i]=o===s?n:typeof(r=u[i])==typeof e?r:0*e[o]!=0||~(""+e[o]).indexOf(".")?{}:[]}"function"==typeof SuppressedError&&SuppressedError;var c=function(t){function e(e,n){var r=t.call(this,"".concat(e," ").concat(n))||this;return r.field=e,r}return n(e,t),e}(Error);function l(t){return"string"==typeof t}function p(t){return"number"==typeof t}function f(t){return"function"==typeof t}function h(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var d="is not a string",v="is not an object";function g(t){!function(t){if(null==t)throw new c("Event","is nil");if("object"!=typeof t)throw new c("Event",v)}(t),function(t){if(!l(t.type))throw new c(".type",d)}(t),function(t){if(!l(t.messageId))throw new c(".messageId",d)}(t),"track"===t.type&&(function(t){if(!l(t.event))throw new c(".event",d)}(t),function(t){if(!h(t.properties))throw new c(".properties",v)}(t)),["group","identify"].includes(t.type)&&function(t){if(!h(t.traits))throw new c(".traits",v)}(t)}var y=function(){return function(t){var e,n;this.settings=t,this.createMessageId=t.createMessageId,this.onEventMethodCall=null!==(e=t.onEventMethodCall)&&void 0!==e?e:function(){},this.onFinishedEvent=null!==(n=t.onFinishedEvent)&&void 0!==n?n:function(){}}}(),m=function(){function t(t){this.settings=new y(t)}return t.prototype.track=function(t,e,n,i){return this.settings.onEventMethodCall({type:"track",options:n}),this.normalize(r(r({},this.baseEvent()),{event:t,type:"track",properties:null!=e?e:{},options:r({},n),integrations:r({},i)}))},t.prototype.page=function(t,e,n,i,o){var s;this.settings.onEventMethodCall({type:"page",options:i});var u={type:"page",properties:r({},n),options:r({},i),integrations:r({},o)};return null!==t&&(u.category=t,u.properties=null!==(s=u.properties)&&void 0!==s?s:{},u.properties.category=t),null!==e&&(u.name=e),this.normalize(r(r({},this.baseEvent()),u))},t.prototype.screen=function(t,e,n,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var s={type:"screen",properties:r({},n),options:r({},i),integrations:r({},o)};return null!==t&&(s.category=t),null!==e&&(s.name=e),this.normalize(r(r({},this.baseEvent()),s))},t.prototype.identify=function(t,e,n,i){return this.settings.onEventMethodCall({type:"identify",options:n}),this.normalize(r(r({},this.baseEvent()),{type:"identify",userId:t,traits:null!=e?e:{},options:r({},n),integrations:i}))},t.prototype.group=function(t,e,n,i){return this.settings.onEventMethodCall({type:"group",options:n}),this.normalize(r(r({},this.baseEvent()),{type:"group",traits:null!=e?e:{},options:r({},n),integrations:r({},i),groupId:t}))},t.prototype.alias=function(t,e,n,i){this.settings.onEventMethodCall({type:"alias",options:n});var o={userId:t,type:"alias",options:r({},n),integrations:r({},i)};return null!==e&&(o.previousId=e),void 0===t?this.normalize(r(r({},o),this.baseEvent())):this.normalize(r(r({},this.baseEvent()),o))},t.prototype.baseEvent=function(){return{integrations:{},options:{}}},t.prototype.context=function(t){var e,n=["userId","anonymousId","timestamp","messageId"];delete t.integrations;var r=Object.keys(t),i=null!==(e=t.context)&&void 0!==e?e:{},o={};return r.forEach((function(e){"context"!==e&&(n.includes(e)?a(o,e,t[e]):a(i,e,t[e]))})),[i,o]},t.prototype.normalize=function(t){var e,n,o,s,u=Object.keys(null!==(e=t.integrations)&&void 0!==e?e:{}).reduce((function(e,n){var i,o;return r(r({},e),((i={})[n]=Boolean(null===(o=t.integrations)||void 0===o?void 0:o[n]),i))}),{});t.options=(o=t.options||{},s=function(t,e){return void 0!==e},Object.keys(o).filter((function(t){return s(t,o[t])})).reduce((function(t,e){return t[e]=o[e],t}),{}));var a=r(r({},u),null===(n=t.options)||void 0===n?void 0:n.integrations),c=t.options?this.context(t.options):[],l=c[0],p=c[1],f=t.options,h=i(t,["options"]),d=r(r(r(r({timestamp:new Date},h),{context:l,integrations:a}),p),{messageId:f.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(d),g(d),d},t}();function b(t,e){return new Promise((function(n,r){var i=setTimeout((function(){r(Error("Promise timed out"))}),e);t.then((function(t){return clearTimeout(i),n(t)})).catch(r)}))}function w(t,e,n){var r;return(r=n,new Promise((function(t){return setTimeout(t,r)}))).then((function(){return b(function(){try{return Promise.resolve(e(t))}catch(n){return Promise.reject(n)}}(),1e3)})).catch((function(e){null==t||t.log("warn","Callback Error",{error:e}),null==t||t.stats.increment("callback_error")})).then((function(){return t}))}for(var E,_="onRemoveFromFuture",O=function(t){function e(e,n,r){var i=t.call(this)||this;return i.future=[],i.maxAttempts=e,i.queue=n,i.seen=null!=r?r:{},i}return n(e,t),e.prototype.push=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.map((function(e){return!(t.updateAttempts(e)>t.maxAttempts||t.includes(e))&&(t.queue.push(e),!0)}));return this.queue=this.queue.sort((function(e,n){return t.getAttempts(e)-t.getAttempts(n)})),r},e.prototype.pushWithBackoff=function(t,e){var n=this;if(void 0===e&&(e=0),0==e&&0===this.getAttempts(t))return this.push(t)[0];var r=this.updateAttempts(t);if(r>this.maxAttempts||this.includes(t))return!1;var i=function(t){var e=Math.random()+1,n=t.minTimeout,r=void 0===n?500:n,i=t.factor,o=void 0===i?2:i,s=t.attempt,u=t.maxTimeout,a=void 0===u?1/0:u;return Math.min(e*r*Math.pow(o,s),a)}({attempt:r-1});return e>0&&i<e&&(i=e),setTimeout((function(){n.queue.push(t),n.future=n.future.filter((function(e){return e.id!==t.id})),n.emit(_)}),i),this.future.push(t),!0},e.prototype.getAttempts=function(t){var e;return null!==(e=this.seen[t.id])&&void 0!==e?e:0},e.prototype.updateAttempts=function(t){return this.seen[t.id]=this.getAttempts(t)+1,this.getAttempts(t)},e.prototype.includes=function(t){return this.queue.includes(t)||this.future.includes(t)||Boolean(this.queue.find((function(e){return e.id===t.id})))||Boolean(this.future.find((function(e){return e.id===t.id})))},e.prototype.pop=function(){return this.queue.shift()},Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e}(t),x=256,j=[];x--;)j[x]=(x+256).toString(16).substring(1);function P(){var t,e=0,n="";if(!E||x+16>256){for(E=Array(e=256);e--;)E[e]=256*Math.random()|0;e=x=0}for(;e<16;e++)t=E[x+e],n+=6==e?j[15&t|64]:8==e?j[63&t|128]:j[t],1&e&&e>1&&e<11&&(n+="-");return x++,n}var q=function(){function t(){this._logs=[]}return t.prototype.log=function(t,e,n){var r=new Date;this._logs.push({level:t,message:e,time:r,extras:n})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var t=this._logs.reduce((function(t,e){var n,i,o,s=r(r({},e),{json:JSON.stringify(e.extras,null," "),extras:e.extras});delete s.time;var u=null!==(o=null===(i=e.time)||void 0===i?void 0:i.toISOString())&&void 0!==o?o:"";return t[u]&&(u="".concat(u,"-").concat(Math.random())),r(r({},t),((n={})[u]=s,n))}),{});console.table?console.table(t):console.log(t)}else this.logs.forEach((function(t){var e=t.level,n=t.message,r=t.extras;"info"===e||"debug"===e?console.log(n,null!=r?r:""):console[e](n,null!=r?r:"")}));this._logs=[]},t}(),D=function(){function t(){this.metrics=[]}return t.prototype.increment=function(t,e,n){void 0===e&&(e=1),this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(t,e,n){this.metrics.push({metric:t,value:e,tags:null!=n?n:[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var t=this.metrics.map((function(t){return r(r({},t),{tags:t.tags.join(",")})}));console.table?console.table(t):console.log(t),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map((function(t){return{m:t.metric,v:t.value,t:t.tags,k:(e=t.type,{gauge:"g",counter:"c"}[e]),e:t.timestamp};var e}))},t}(),k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.gauge=function(){},e.prototype.increment=function(){},e.prototype.flush=function(){},e.prototype.serialize=function(){return[]},e}(D),S=function(){return function(t){var e,n,r;this.retry=null===(e=t.retry)||void 0===e||e,this.type=null!==(n=t.type)&&void 0!==n?n:"plugin Error",this.reason=null!==(r=t.reason)&&void 0!==r?r:""}}(),I=function(){function t(t,e,n,r){void 0===e&&(e=P()),void 0===n&&(n=new k),void 0===r&&(r=new q),this.attempts=0,this.event=t,this._id=e,this.logger=r,this.stats=n}return t.system=function(){},t.prototype.isSame=function(t){return t.id===this.id},t.prototype.cancel=function(t){if(t)throw t;throw new S({reason:"Context Cancel"})},t.prototype.log=function(t,e,n){this.logger.log(t,e,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(t,e){var n;if("integrations"===t.split(".")[0]){var r=t.split(".")[1];if(!1===(null===(n=this.event.integrations)||void 0===n?void 0:n[r]))return this.event}return a(this.event,t,e),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(t){this._failedDelivery=t},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t}();function A(t,e){t.log("debug","plugin",{plugin:e.name});var n=(new Date).getTime(),r=e[t.event.type];return void 0===r?Promise.resolve(t):function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t()];case 1:return[2,n.sent()];case 2:return e=n.sent(),[2,Promise.reject(e)];case 3:return[2]}}))}))}((function(){return r.apply(e,[t])})).then((function(t){var r=(new Date).getTime()-n;return t.stats.gauge("plugin_time",r,["plugin:".concat(e.name)]),t})).catch((function(n){if(n instanceof S&&"middleware_cancellation"===n.type)throw n;return n instanceof S?(t.log("warn",n.type,{plugin:e.name,error:n}),n):(t.log("error","plugin Error",{plugin:e.name,error:n}),t.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),n)}))}function T(t,e){return A(t,e).then((function(e){if(e instanceof I)return e;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(e)}))}var M=function(t){function e(e){var n,r,i,o=t.call(this)||this;return o.criticalTasks=(i=0,{done:function(){return n},run:function(t){var e,o=t();return"object"==typeof(e=o)&&null!==e&&"then"in e&&"function"==typeof e.then&&(1==++i&&(n=new Promise((function(t){return r=t}))),o.finally((function(){return 0==--i&&r()}))),o}}),o.plugins=[],o.failedInitializations=[],o.flushing=!1,o.queue=e,o.queue.on(_,(function(){o.scheduleFlush(0)})),o}return n(e,t),e.prototype.register=function(t,e,n){return o(this,void 0,void 0,(function(){var r,i,o=this;return s(this,(function(s){switch(s.label){case 0:return this.plugins.push(e),r=function(n){o.failedInitializations.push(e.name),o.emit("initialization_failure",e),console.warn(e.name,n),t.log("warn","Failed to load destination",{plugin:e.name,error:n}),o.plugins=o.plugins.filter((function(t){return t!==e}))},"destination"!==e.type||"Segment.io"===e.name?[3,1]:(e.load(t,n).catch(r),[3,4]);case 1:return s.trys.push([1,3,,4]),[4,e.load(t,n)];case 2:return s.sent(),[3,4];case 3:return i=s.sent(),r(i),[3,4];case 4:return[2]}}))}))},e.prototype.deregister=function(t,e,n){return o(this,void 0,void 0,(function(){var r;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.unload?[4,Promise.resolve(e.unload(t,n))]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.plugins=this.plugins.filter((function(t){return t.name!==e.name})),[3,4];case 3:return r=i.sent(),t.log("warn","Failed to unload destination",{plugin:e.name,error:r}),[3,4];case 4:return[2]}}))}))},e.prototype.dispatch=function(t){return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.push(t),e=this.subscribeToDelivery(t),this.scheduleFlush(0),[2,e]}))}))},e.prototype.subscribeToDelivery=function(t){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return[2,new Promise((function(n){var r=function(i,o){i.isSame(t)&&(e.off("flush",r),n(i))};e.on("flush",r)}))]}))}))},e.prototype.dispatchSingle=function(t){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(n){return t.log("debug","Dispatching"),t.stats.increment("message_dispatched"),this.queue.updateAttempts(t),t.attempts=1,[2,this.deliver(t).catch((function(n){return e.enqueuRetry(n,t)?e.subscribeToDelivery(t):(t.setFailedDelivery({reason:n}),t)}))]}))}))},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.scheduleFlush=function(t){var e=this;void 0===t&&(t=500),this.flushing||(this.flushing=!0,setTimeout((function(){e.flush().then((function(){setTimeout((function(){e.flushing=!1,e.queue.length&&e.scheduleFlush(0)}),0)}))}),t))},e.prototype.deliver=function(t){return o(this,void 0,void 0,(function(){var e,n,r,i;return s(this,(function(o){switch(o.label){case 0:return[4,this.criticalTasks.done()];case 1:o.sent(),e=Date.now(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.flushOne(t)];case 3:return t=o.sent(),n=Date.now()-e,this.emit("delivery_success",t),t.stats.gauge("delivered",n),t.log("debug","Delivered",t.event),[2,t];case 4:throw r=o.sent(),i=r,t.log("error","Failed to deliver",i),this.emit("delivery_failure",t,i),t.stats.increment("delivery_failed"),r;case 5:return[2]}}))}))},e.prototype.enqueuRetry=function(t,e){return!(t instanceof S&&!t.retry)&&this.queue.pushWithBackoff(e)},e.prototype.flush=function(){return o(this,void 0,void 0,(function(){var t,e;return s(this,(function(n){switch(n.label){case 0:if(0===this.queue.length)return[2,[]];if(!(t=this.queue.pop()))return[2,[]];t.attempts=this.queue.getAttempts(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deliver(t)];case 2:return t=n.sent(),this.emit("flush",t,!0),[3,4];case 3:return e=n.sent(),this.enqueuRetry(e,t)||(t.setFailedDelivery({reason:e}),this.emit("flush",t,!1)),[2,[]];case 4:return[2,[t]]}}))}))},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(t){var e,n,r=this.plugins.filter((function(e){var n,r,i;if("destination"!==e.type&&"Segment.io"!==e.name)return!0;var o=void 0;return null===(n=e.alternativeNames)||void 0===n||n.forEach((function(e){void 0!==t[e]&&(o=t[e])})),null!==(i=null!==(r=t[e.name])&&void 0!==r?r:o)&&void 0!==i?i:!1!==("Segment.io"===e.name||t.All)})),i=(e="type",n={},r.forEach((function(t){var r,i,o=t[e];void 0!==(i="string"!=typeof o?JSON.stringify(o):o)&&(n[i]=u(u([],null!==(r=n[i])&&void 0!==r?r:[],!0),[t],!1))})),n),o=i.before,s=void 0===o?[]:o,a=i.enrichment,c=void 0===a?[]:a,l=i.destination,p=void 0===l?[]:l,f=i.after;return{before:s,enrichment:c,destinations:p,after:void 0===f?[]:f}},e.prototype.flushOne=function(t){var e,n;return o(this,void 0,void 0,(function(){var r,i,o,u,a,c,l,p,f,h,d,v,g,y;return s(this,(function(s){switch(s.label){case 0:if(!this.isReady())throw new Error("Not ready");t.attempts>1&&this.emit("delivery_retry",t),r=this.availableExtensions(null!==(e=t.event.integrations)&&void 0!==e?e:{}),i=r.before,o=r.enrichment,u=0,a=i,s.label=1;case 1:return u<a.length?(c=a[u],[4,T(t,c)]):[3,4];case 2:(h=s.sent())instanceof I&&(t=h),this.emit("message_enriched",t,c),s.label=3;case 3:return u++,[3,1];case 4:l=0,p=o,s.label=5;case 5:return l<p.length?(f=p[l],[4,A(t,f)]):[3,8];case 6:(h=s.sent())instanceof I&&(t=h),this.emit("message_enriched",t,f),s.label=7;case 7:return l++,[3,5];case 8:return d=this.availableExtensions(null!==(n=t.event.integrations)&&void 0!==n?n:{}),v=d.destinations,g=d.after,[4,new Promise((function(e,n){setTimeout((function(){var r=v.map((function(e){return A(t,e)}));Promise.all(r).then(e).catch(n)}),0)}))];case 9:return s.sent(),t.stats.increment("message_delivered"),this.emit("message_delivered",t),y=g.map((function(e){return A(t,e)})),[4,Promise.all(y)];case 10:return s.sent(),[2,t]}}))}))},e}(t);function C(t,e,n,r){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return n.emit("dispatch_start",t),i=Date.now(),e.isEmpty()?[4,e.dispatchSingle(t)]:[3,2];case 1:return o=s.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:o=s.sent(),s.label=4;case 4:return(null==r?void 0:r.callback)?[4,w(o,r.callback,(u=i,a=r.timeout,c=Date.now()-u,Math.max((null!=a?a:300)-c,0)))]:[3,6];case 5:o=s.sent(),s.label=6;case 6:return(null==r?void 0:r.debug)&&o.flush(),[2,o]}var u,a,c}))}))}export{D as C,O as P,o as _,l as a,f as b,p as c,s as d,r as e,n as f,I as g,u as h,h as i,m as j,M as k,i as l,A as m,C as n,S as o,b as p,P as v};